<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>自荐管理</h2>
    </div>
    <style>
        .fr span{}
    </style>
    <div class="data-table table-striped">
        <form class="ids">
            <table>
                <thead>
                    <tr>
                        <th>老师</th>
                        <th>学生</th>
                        <th>自荐内容</th>
                        <th>时间</th>
                        
                    </tr>
                </thead>
                <tbody>
				<notempty name="data">
                <volist name="data" id="v">
                    <tr>
                        <td width="20%">{$v.sname}</td>
                        <td width="20%">{$v.rname}</td>
                        <td width="40%">{$v.content}</td>
                        <td width="20%">{$v.time}</td>
                    </tr>
                </volist>
				<else/>
				<td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
				</notempty>
                </tbody>
            </table>
        </form>
        <!-- 分页 -->
        <div class="page">
            {$_page}
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function() {
            $('.oper').click(function(){
                var mes = $(this).html();
                if (confirm('确定要'+mes+'吗？')) {
                    var id = $(this).attr('data');
                    var val = $(this).attr('val');
                    var flag = $(this).attr('flag');
                    $.post('__CONTROLLER__/edit', {'id': id,'val':val, 'flag':flag}, function(msg) {
                        alert(msg);
                        location.reload();
                    });
                }
            });

$("#search").click(function(){
        var str = $("#campus").val();
        var num = $('.drop-down span').html();
        var replaces = $('.drop-down span').html();
                switch(num)
                {
                case '昵称':
                    num = 'nickname';
                  break;
                case '手机号':
                    num = 'mobile';
                  break;
                }
        window.location.href="__CONTROLLER__/showUser/str/"+str+"/num/"+num+"/replaces/"+replaces;
    });

    /* 状态搜索子菜单 */
    $(".search-form").find(".drop-down").hover(function(){
        $("#sub-sch-menu").removeClass("hidden");
    },function(){
        $("#sub-sch-menu").addClass("hidden");
    });
    $("#sub-sch-menu li").find("a").each(function(){
        $(this).click(function(){
            var text = $(this).text();
            $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
            $("#sub-sch-menu").addClass("hidden");
        })
    });

    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

  });
    </script>
</block>